
import java.lang.reflect.InvocationTargetException;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Peter
 */
public class PetersClassLoader 
{
    ClassLoader myClassLoader;
    
    /**
     * The default Constructor. It initializes the class loader to the System's ClassLoader.
     */
    PetersClassLoader()
    {
        myClassLoader = ClassLoader.getSystemClassLoader();
    }
    
    /**
     * This method loads the class provided in the format <package>.className (No file extension).  
     * @param className String. The name of the class to load.
     * @return Class. Returns the class loaded.
     * @throws ClassNotFoundException
     * @throws InstantiationException
     * @throws IllegalAccessException
     * @throws NoSuchMethodException
     * @throws IllegalArgumentException
     * @throws InvocationTargetException 
     */
    Class loadClass(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, IllegalArgumentException, InvocationTargetException
    {
        Class myClass = myClassLoader.loadClass(className);
        
        return myClass;
    }
    
    
}
